
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3.1 用户脚手架 · Laravel学习-从零开发论坛系统</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="kaleozhou">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="2.html" />
    
    
    <link rel="prev" href="readme.html" />
    

    
        <link rel="shortcut icon" href='../book.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../book.ico' type="image/x-icon">
    
    
        <link rel="apple-touch-icon" href='../book.ico'>
    
    
        
        <link rel="apple-touch-icon" sizes="120x120" href="../book.ico">
        
        <link rel="apple-touch-icon" sizes="180x180" href="../book.ico">
        
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.kaleozhou.top" target="_blank" class="custom-link">我的博客</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    序言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter1/1.html">
            
                <a href="../chapter1/1.html">
            
                    
                    第一章 开发环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter2/readme.html">
            
                <a href="../chapter2/readme.html">
            
                    
                    第二章 创建应用及布局
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter2/1.html">
            
                <a href="../chapter2/1.html">
            
                    
                    2.1 创建应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter2/2.html">
            
                <a href="../chapter2/2.html">
            
                    
                    2.2 创建布局文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter2/3.html">
            
                <a href="../chapter2/3.html">
            
                    
                    2.3 创建首页展示
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter2/4.html">
            
                <a href="../chapter2/4.html">
            
                    
                    2.4 调整样式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="readme.html">
            
                <a href="readme.html">
            
                    
                    第三章 laravel组件的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.4.1" data-path="1.html">
            
                <a href="1.html">
            
                    
                    3.1 用户脚手架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="2.html">
            
                <a href="2.html">
            
                    
                    3.2 注册验证码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="3.html">
            
                <a href="3.html">
            
                    
                    3.3 邮箱验证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="4.html">
            
                <a href="4.html">
            
                    
                    3.4 密码重置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter4/readme.html">
            
                <a href="../chapter4/readme.html">
            
                    
                    第四章 基础功能开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter4/1.html">
            
                <a href="../chapter4/1.html">
            
                    
                    4.1 个人页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter4/2.html">
            
                <a href="../chapter4/2.html">
            
                    
                    4.2 编辑个人资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../chapter4/3.html">
            
                <a href="../chapter4/3.html">
            
                    
                    4.3 显示个人资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../chapter4/4.html">
            
                <a href="../chapter4/4.html">
            
                    
                    4.4 上传头像
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter5/readme.html">
            
                <a href="../chapter5/readme.html">
            
                    
                    第五章 帖子功能开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter5/1.html">
            
                <a href="../chapter5/1.html">
            
                    
                    5.1 帖子分类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter5/2.html">
            
                <a href="../chapter5/2.html">
            
                    
                    5.2 代码生成器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../chapter5/3.html">
            
                <a href="../chapter5/3.html">
            
                    
                    5.3 生成话题骨架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../chapter5/4.html">
            
                <a href="../chapter5/4.html">
            
                    
                    5.4 假数据填充
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../chapter5/5.html">
            
                <a href="../chapter5/5.html">
            
                    
                    5.5 话题列表页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../chapter5/6.html">
            
                <a href="../chapter5/6.html">
            
                    
                    5.6 性能优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../chapter5/7.html">
            
                <a href="../chapter5/7.html">
            
                    
                    5.7 分类下的话题列表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../chapter5/8.html">
            
                <a href="../chapter5/8.html">
            
                    
                    5.8 话题排序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../chapter5/9.html">
            
                <a href="../chapter5/9.html">
            
                    
                    5.9 用户发布的话题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../chapter6/readme.html">
            
                <a href="../chapter6/readme.html">
            
                    
                    第六章 话题开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../chapter6/1.html">
            
                <a href="../chapter6/1.html">
            
                    
                    6.1 新建话题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../chapter6/2.html">
            
                <a href="../chapter6/2.html">
            
                    
                    6.2 编辑器优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../chapter6/3.html">
            
                <a href="../chapter6/3.html">
            
                    
                    6.3 上传图片
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../chapter6/4.html">
            
                <a href="../chapter6/4.html">
            
                    
                    6.4 显示帖子
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../chapter6/5.html">
            
                <a href="../chapter6/5.html">
            
                    
                    6.5 XSS安全漏洞
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../chapter6/6.html">
            
                <a href="../chapter6/6.html">
            
                    
                    6.6 编辑帖子
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >3.1 用户脚手架</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#31-&#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x624B;&#x67B6;"><b></b>3.1 &#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x624B;&#x67B6;</a></li><ul><li><span class="title-icon "></span><a href="#1-&#x751F;&#x6210;&#x4EE3;&#x7801;"><b></b>1. &#x751F;&#x6210;&#x4EE3;&#x7801;</a></li><ul><li><span class="title-icon "></span><a href="#&#x5220;&#x9664;&#x591A;&#x4F59;&#x6587;&#x4EF6;"><b></b>&#x5220;&#x9664;&#x591A;&#x4F59;&#x6587;&#x4EF6;</a></li></ul><li><span class="title-icon "></span><a href="#2-&#x9876;&#x90E8;&#x5BFC;&#x822A;&#x90E8;&#x5206;&#x4FEE;&#x6539;"><b></b>2. &#x9876;&#x90E8;&#x5BFC;&#x822A;&#x90E8;&#x5206;&#x4FEE;&#x6539;</a></li><li><span class="title-icon "></span><a href="#3-&#x672C;&#x5730;&#x5316;&#x5B89;&#x88C5;&#x4E2D;&#x6587;&#x8BED;&#x8A00;&#x5305;"><b></b>3. &#x672C;&#x5730;&#x5316;&#x5B89;&#x88C5;&#x4E2D;&#x6587;&#x8BED;&#x8A00;&#x5305;</a></li><li><span class="title-icon "></span><a href="#4-&#x7528;&#x6237;&#x6CE8;&#x518C;"><b></b>4. &#x7528;&#x6237;&#x6CE8;&#x518C;</a></li><ul><li><span class="title-icon "></span><a href="#&#x6267;&#x884C;&#x547D;&#x4EE4;&#x5B8C;&#x6210;&#x8FC1;&#x79FB;"><b></b>&#x6267;&#x884C;&#x547D;&#x4EE4;&#x5B8C;&#x6210;&#x8FC1;&#x79FB;</a></li><li><span class="title-icon "></span><a href="#&#x4FEE;&#x6539;&#x4E00;&#x4E0B;&#x51E0;&#x5904;&#xFF0C;&#x5C06;home&#x66FF;&#x6362;&#x4E3A;"><b></b>&#x4FEE;&#x6539;&#x4E00;&#x4E0B;&#x51E0;&#x5904;&#xFF0C;&#x5C06;&quot;/home&quot;&quot;&#x66FF;&#x6362;&#x4E3A;&quot;/&quot;</a></li></ul><li><span class="title-icon "></span><a href="#5-&#x4FEE;&#x6539;&#x7528;&#x6237;&#x767B;&#x5F55;&#x72B6;&#x6001;"><b></b>5. &#x4FEE;&#x6539;&#x7528;&#x6237;&#x767B;&#x5F55;&#x72B6;&#x6001;</a></li><ul><li><span class="title-icon "></span><a href="#&#x767B;&#x5F55;&#x540E;&#x7684;&#x6548;&#x679C;"><b></b>&#x767B;&#x5F55;&#x540E;&#x7684;&#x6548;&#x679C;</a></li></ul></ul></ul></div><a href="#31-&#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x624B;&#x67B6;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="31-&#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x624B;&#x67B6;"><a name="31-&#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x624B;&#x67B6;" class="anchor-navigation-ex-anchor" href="#31-&#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x624B;&#x67B6;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="31-&#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x624B;&#x67B6;" class="plugin-anchor" href="#31-&#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x624B;&#x67B6;"><i class="fa fa-link" aria-hidden="true"></i></a>3.1 &#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x624B;&#x67B6;</h1>
<p>Laravel&#x81EA;&#x5E26;&#x7684;&#x7528;&#x6237;&#x8BA4;&#x8BC1;&#x529F;&#x80FD;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x7528;&#x8FD9;&#x4E2A;&#x529F;&#x80FD;&#x5FEB;&#x901F;&#x7684;&#x6784;&#x5EFA;&#x6211;&#x4EEC;&#x7684;&#x7528;&#x6237;&#x4E2D;&#x5FC3;</p>
<h2 id="1-&#x751F;&#x6210;&#x4EE3;&#x7801;"><a name="1-&#x751F;&#x6210;&#x4EE3;&#x7801;" class="anchor-navigation-ex-anchor" href="#1-&#x751F;&#x6210;&#x4EE3;&#x7801;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="1-&#x751F;&#x6210;&#x4EE3;&#x7801;" class="plugin-anchor" href="#1-&#x751F;&#x6210;&#x4EE3;&#x7801;"><i class="fa fa-link" aria-hidden="true"></i></a>1. &#x751F;&#x6210;&#x4EE3;&#x7801;</h2>
<pre><code>vagrant@homestead:~/Code/kaleobbs$ php artisan make:auth

 The [layouts/app.blade.php] view already exists. Do you want to replace it? (yes/no) [no]:
 &gt; no

Authentication scaffolding generated successfully.
</code></pre><p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;git status&#x770B;&#x770B;&#x591A;&#x4E86;&#x90A3;&#x4E9B;&#x5185;&#x5BB9;</p>
<pre><code>&#x279C; kaleo@zhou  ~/Code/kaleobbs git:(master) &#x2717; git status
On branch master
Your branch is up to date with &apos;origin/master&apos;.

Changes not staged for commit:
  (use &quot;git add &lt;file&gt;...&quot; to update what will be committed)
  (use &quot;git checkout -- &lt;file&gt;...&quot; to discard changes in working directory)

    modified:   .readme.md.swp
    modified:   readme.md
    modified:   routes/web.php

Untracked files:
  (use &quot;git add &lt;file&gt;...&quot; to include in what will be committed)

    app/Http/Controllers/HomeController.php
    resources/views/auth/
    resources/views/home.blade.php

no changes added to commit (use &quot;git add&quot; and/or &quot;git commit -a&quot;)
</code></pre><p>&#x6253;&#x5F00;routes/web.php</p>
<pre><code>&lt;?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the &quot;web&quot; middleware group. Now create something great!
|
*/

Route::get(&apos;/&apos;,&apos;PagesController@root&apos;)-&gt;name(&apos;root&apos;);

Auth::routes();

Route::get(&apos;/home&apos;, &apos;HomeController@index&apos;)-&gt;name(&apos;home&apos;);
</code></pre><p>&#x591A;&#x4E86;&#x4E00;&#x884C;Auth::routes();,&#x5220;&#x9664;&#x65E0;&#x7528;&#x7684;home&#x9875;&#x9762;&#x76F8;&#x5173;&#x7684;&#x8DEF;&#x7531;&#x548C;&#x6587;&#x4EF6;
&#x5220;&#x9664;&#x8FC7;&#x7684;routes/web.php</p>
<pre><code>
&lt;?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the &quot;web&quot; middleware group. Now create something great!
|
*/

Route::get(&apos;/&apos;,&apos;PagesController@root&apos;)-&gt;name(&apos;root&apos;);

Auth::routes();
</code></pre><h3 id="&#x5220;&#x9664;&#x591A;&#x4F59;&#x6587;&#x4EF6;"><a name="&#x5220;&#x9664;&#x591A;&#x4F59;&#x6587;&#x4EF6;" class="anchor-navigation-ex-anchor" href="#&#x5220;&#x9664;&#x591A;&#x4F59;&#x6587;&#x4EF6;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x5220;&#x9664;&#x591A;&#x4F59;&#x6587;&#x4EF6;" class="plugin-anchor" href="#&#x5220;&#x9664;&#x591A;&#x4F59;&#x6587;&#x4EF6;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5220;&#x9664;&#x591A;&#x4F59;&#x6587;&#x4EF6;</h3>
<pre><code>&#x279C; kaleo@zhou  ~/Code/kaleobbs git:(master) &#x2717; rm app/Http/Controllers/HomeController.php
&#x279C; kaleo@zhou  ~/Code/kaleobbs git:(master) &#x2717; rm resources/views/home.blade.php
</code></pre><h2 id="2-&#x9876;&#x90E8;&#x5BFC;&#x822A;&#x90E8;&#x5206;&#x4FEE;&#x6539;"><a name="2-&#x9876;&#x90E8;&#x5BFC;&#x822A;&#x90E8;&#x5206;&#x4FEE;&#x6539;" class="anchor-navigation-ex-anchor" href="#2-&#x9876;&#x90E8;&#x5BFC;&#x822A;&#x90E8;&#x5206;&#x4FEE;&#x6539;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="2-&#x9876;&#x90E8;&#x5BFC;&#x822A;&#x90E8;&#x5206;&#x4FEE;&#x6539;" class="plugin-anchor" href="#2-&#x9876;&#x90E8;&#x5BFC;&#x822A;&#x90E8;&#x5206;&#x4FEE;&#x6539;"><i class="fa fa-link" aria-hidden="true"></i></a>2. &#x9876;&#x90E8;&#x5BFC;&#x822A;&#x90E8;&#x5206;&#x4FEE;&#x6539;</h2>
<p>&#x9876;&#x90E8;&#x53F7;&#x822A;&#x6CE8;&#x518C;&#x548C;&#x767B;&#x5F55;&#x8FDE;&#x63A5;&#x5957;&#x8FDB;&#x53BB;,&#x4FEE;&#x6539;&#x5982;&#x4E0B;:</p>
<pre><code>&lt;nav class=&quot;navbar navbar-expand-lg navbar-light bg-light navbar-static-top&quot;&gt;
  &lt;div class=&quot;container&quot;&gt;
    &lt;!-- Branding Image --&gt;
    &lt;a class=&quot;navbar-brand &quot; href=&quot;{{ url(&apos;/&apos;) }}&quot;&gt;
      kaleobbs
    &lt;/a&gt;
    &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#navbarSupportedContent&quot; aria-controls=&quot;navbarSupportedContent&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle navigation&quot;&gt;
      &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;
    &lt;/button&gt;

    &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;navbarSupportedContent&quot;&gt;
      &lt;!-- Left Side Of Navbar --&gt;
      &lt;ul class=&quot;navbar-nav mr-auto&quot;&gt;

      &lt;/ul&gt;

      &lt;!-- Right Side Of Navbar --&gt;
      &lt;ul class=&quot;navbar-nav navbar-right&quot;&gt;
        &lt;!-- Authentication Links --&gt;
        &lt;li class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link&quot; href=&quot;{{route(&apos;login&apos;)}}&quot;&gt;&#x767B;&#x5F55;&lt;/a&gt;&lt;/li&gt;
        &lt;li class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link&quot; href=&quot;{{route(&apos;register&apos;)}}&quot;&gt;&#x6CE8;&#x518C;&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/nav&gt;
</code></pre><h2 id="3-&#x672C;&#x5730;&#x5316;&#x5B89;&#x88C5;&#x4E2D;&#x6587;&#x8BED;&#x8A00;&#x5305;"><a name="3-&#x672C;&#x5730;&#x5316;&#x5B89;&#x88C5;&#x4E2D;&#x6587;&#x8BED;&#x8A00;&#x5305;" class="anchor-navigation-ex-anchor" href="#3-&#x672C;&#x5730;&#x5316;&#x5B89;&#x88C5;&#x4E2D;&#x6587;&#x8BED;&#x8A00;&#x5305;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="3-&#x672C;&#x5730;&#x5316;&#x5B89;&#x88C5;&#x4E2D;&#x6587;&#x8BED;&#x8A00;&#x5305;" class="plugin-anchor" href="#3-&#x672C;&#x5730;&#x5316;&#x5B89;&#x88C5;&#x4E2D;&#x6587;&#x8BED;&#x8A00;&#x5305;"><i class="fa fa-link" aria-hidden="true"></i></a>3. &#x672C;&#x5730;&#x5316;&#x5B89;&#x88C5;&#x4E2D;&#x6587;&#x8BED;&#x8A00;&#x5305;</h2>
<p>&#x6211;&#x4EEC;&#x4F7F;&#x7528;Laravel lang&#x9879;&#x76EE;&#x6765;&#x5B8C;&#x6210;&#xFF0C;&#x6B64;&#x9879;&#x76EE;&#x652F;&#x6301;52&#x4E2A;&#x56FD;&#x5BB6;&#x7684;&#x8BED;&#x8A00;&#xFF0C;&#x4F7F;&#x7528;&#x5982;&#x4E0B;&#x547D;&#x4EE4;&#x5B89;&#x88C5;</p>
<pre><code>vagrant@homestead:~/Code/kaleobbs$ composer require &quot;overtrue/laravel-lang:~3.0&quot;
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing caouecs/laravel-lang (3.0.62): Downloading (100%)
  - Installing overtrue/laravel-lang (3.0.16): Downloading (100%)
caouecs/laravel-lang suggests installing arcanedev/laravel-lang (Translations manager and checker for Laravel 5)
caouecs/laravel-lang suggests installing ablunier/laravel-lang-installer (Command for easily add languages to a Laravel project)
caouecs/laravel-lang suggests installing andrey-helldar/laravel-lang-publisher (Easy installation and update of translation files for your project)
Writing lock file
Generating optimized autoload files
&gt; Illuminate\Foundation\ComposerScripts::postAutoloadDump
&gt; @php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: laravel/nexmo-notification-channel
Discovered Package: laravel/slack-notification-channel
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
</code></pre><p>&#x4FEE;&#x6539;config/app.php</p>
<pre><code>Illuminate\Translation\TranslationServiceProvider::class,
</code></pre><p>&#x66FF;&#x6362;&#x5982;&#x4E0B;:</p>
<pre><code>Overtrue\LaravelLang\TranslationServiceProvider::class,
</code></pre><p>&#x67E5;&#x770B;&#x6548;&#x679C;:
<img src="http://images.kaleozhou.top/3.1-01.png" alt="3.1-01.png"></p>
<h2 id="4-&#x7528;&#x6237;&#x6CE8;&#x518C;"><a name="4-&#x7528;&#x6237;&#x6CE8;&#x518C;" class="anchor-navigation-ex-anchor" href="#4-&#x7528;&#x6237;&#x6CE8;&#x518C;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="4-&#x7528;&#x6237;&#x6CE8;&#x518C;" class="plugin-anchor" href="#4-&#x7528;&#x6237;&#x6CE8;&#x518C;"><i class="fa fa-link" aria-hidden="true"></i></a>4. &#x7528;&#x6237;&#x6CE8;&#x518C;</h2>
<h3 id="&#x6267;&#x884C;&#x547D;&#x4EE4;&#x5B8C;&#x6210;&#x8FC1;&#x79FB;"><a name="&#x6267;&#x884C;&#x547D;&#x4EE4;&#x5B8C;&#x6210;&#x8FC1;&#x79FB;" class="anchor-navigation-ex-anchor" href="#&#x6267;&#x884C;&#x547D;&#x4EE4;&#x5B8C;&#x6210;&#x8FC1;&#x79FB;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x6267;&#x884C;&#x547D;&#x4EE4;&#x5B8C;&#x6210;&#x8FC1;&#x79FB;" class="plugin-anchor" href="#&#x6267;&#x884C;&#x547D;&#x4EE4;&#x5B8C;&#x6210;&#x8FC1;&#x79FB;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6267;&#x884C;&#x547D;&#x4EE4;&#x5B8C;&#x6210;&#x8FC1;&#x79FB;</h3>
<pre><code>vagrant@homestead:~/Code/kaleobbs$ php artisan migrate
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table
</code></pre><h3 id="&#x4FEE;&#x6539;&#x4E00;&#x4E0B;&#x51E0;&#x5904;&#xFF0C;&#x5C06;home&#x66FF;&#x6362;&#x4E3A;"><a name="&#x4FEE;&#x6539;&#x4E00;&#x4E0B;&#x51E0;&#x5904;&#xFF0C;&#x5C06;home&#x66FF;&#x6362;&#x4E3A;" class="anchor-navigation-ex-anchor" href="#&#x4FEE;&#x6539;&#x4E00;&#x4E0B;&#x51E0;&#x5904;&#xFF0C;&#x5C06;home&#x66FF;&#x6362;&#x4E3A;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x4FEE;&#x6539;&#x4E00;&#x4E0B;&#x51E0;&#x5904;&#xFF0C;&#x5C06;home&#x66FF;&#x6362;&#x4E3A;" class="plugin-anchor" href="#&#x4FEE;&#x6539;&#x4E00;&#x4E0B;&#x51E0;&#x5904;&#xFF0C;&#x5C06;home&#x66FF;&#x6362;&#x4E3A;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4FEE;&#x6539;&#x4E00;&#x4E0B;&#x51E0;&#x5904;&#xFF0C;&#x5C06;&quot;/home&quot;&quot;&#x66FF;&#x6362;&#x4E3A;&quot;/&quot;</h3>
<pre><code>&#x279C; kaleo@zhou  ~/Code/kaleobbs git:(master) &#x2717; vim app/Http/Controllers/Auth/LoginController.php
&#x279C; kaleo@zhou  ~/Code/kaleobbs git:(master) &#x2717; vim app/Http/Controllers/Auth/RegisterController.php
&#x279C; kaleo@zhou  ~/Code/kaleobbs git:(master) &#x2717; vim app/Http/Controllers/Auth/ResetPasswordController.php
&#x279C; kaleo@zhou  ~/Code/kaleobbs git:(master) &#x2717; vim app/Http/Controllers/Auth/VerificationController.php
&#x279C; kaleo@zhou  ~/Code/kaleobbs git:(master) &#x2717; vim app/Http/Middleware/RedirectIfAuthenticated.php
</code></pre><h2 id="5-&#x4FEE;&#x6539;&#x7528;&#x6237;&#x767B;&#x5F55;&#x72B6;&#x6001;"><a name="5-&#x4FEE;&#x6539;&#x7528;&#x6237;&#x767B;&#x5F55;&#x72B6;&#x6001;" class="anchor-navigation-ex-anchor" href="#5-&#x4FEE;&#x6539;&#x7528;&#x6237;&#x767B;&#x5F55;&#x72B6;&#x6001;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="5-&#x4FEE;&#x6539;&#x7528;&#x6237;&#x767B;&#x5F55;&#x72B6;&#x6001;" class="plugin-anchor" href="#5-&#x4FEE;&#x6539;&#x7528;&#x6237;&#x767B;&#x5F55;&#x72B6;&#x6001;"><i class="fa fa-link" aria-hidden="true"></i></a>5. &#x4FEE;&#x6539;&#x7528;&#x6237;&#x767B;&#x5F55;&#x72B6;&#x6001;</h2>
<pre><code>&lt;nav class=&quot;navbar navbar-expand-lg navbar-light bg-light navbar-static-top&quot;&gt;
  &lt;div class=&quot;container&quot;&gt;
    &lt;!-- Branding Image --&gt;
    &lt;a class=&quot;navbar-brand &quot; href=&quot;{{ url(&apos;/&apos;) }}&quot;&gt;
      kaleobbs
    &lt;/a&gt;
    &lt;button class=&quot;navbar-toggler&quot; type=&quot;button&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#navbarSupportedContent&quot; aria-controls=&quot;navbarSupportedContent&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle navigation&quot;&gt;
      &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;
    &lt;/button&gt;

    &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;navbarSupportedContent&quot;&gt;
      &lt;!-- Left Side Of Navbar --&gt;
      &lt;ul class=&quot;navbar-nav mr-auto&quot;&gt;

      &lt;/ul&gt;

      &lt;!-- Right Side Of Navbar --&gt;
      &lt;ul class=&quot;navbar-nav navbar-right&quot;&gt;
        &lt;!-- Authentication Links --&gt;
        @guest
          &lt;li class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link&quot; href=&quot;{{ route(&apos;login&apos;) }}&quot;&gt;&#x767B;&#x5F55;&lt;/a&gt;&lt;/li&gt;
          &lt;li class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link&quot; href=&quot;{{ route(&apos;register&apos;) }}&quot;&gt;&#x6CE8;&#x518C;&lt;/a&gt;&lt;/li&gt;
        @else
          &lt;li class=&quot;nav-item dropdown&quot;&gt;
            &lt;a class=&quot;nav-link dropdown-toggle&quot; href=&quot;#&quot; id=&quot;navbarDropdown&quot; role=&quot;button&quot; data-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;
              &lt;img src=&quot;https://iocaffcdn.phphub.org/uploads/images/201709/20/1/PtDKbASVcz.png?imageView2/1/w/60/h/60&quot; class=&quot;img-responsive img-circle&quot; width=&quot;30px&quot; height=&quot;30px&quot;&gt;
              {{ Auth::user()-&gt;name }}
            &lt;/a&gt;
            &lt;div class=&quot;dropdown-menu&quot; aria-labelledby=&quot;navbarDropdown&quot;&gt;
              &lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt;&#x4E2A;&#x4EBA;&#x4E2D;&#x5FC3;&lt;/a&gt;
              &lt;a class=&quot;dropdown-item&quot; href=&quot;&quot;&gt;&#x7F16;&#x8F91;&#x8D44;&#x6599;&lt;/a&gt;
              &lt;div class=&quot;dropdown-divider&quot;&gt;&lt;/div&gt;
              &lt;a class=&quot;dropdown-item&quot; id=&quot;logout&quot; href=&quot;#&quot;&gt;
                &lt;form action=&quot;{{ route(&apos;logout&apos;) }}&quot; method=&quot;POST&quot;&gt;
                  {{ csrf_field() }}
                  &lt;button class=&quot;btn btn-block btn-danger&quot; type=&quot;submit&quot; name=&quot;button&quot;&gt;&#x9000;&#x51FA;&lt;/button&gt;
                &lt;/form&gt;
              &lt;/a&gt;
            &lt;/div&gt;
          &lt;/li&gt;
        @endguest
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/nav&gt;
</code></pre><h3 id="&#x767B;&#x5F55;&#x540E;&#x7684;&#x6548;&#x679C;"><a name="&#x767B;&#x5F55;&#x540E;&#x7684;&#x6548;&#x679C;" class="anchor-navigation-ex-anchor" href="#&#x767B;&#x5F55;&#x540E;&#x7684;&#x6548;&#x679C;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x767B;&#x5F55;&#x540E;&#x7684;&#x6548;&#x679C;" class="plugin-anchor" href="#&#x767B;&#x5F55;&#x540E;&#x7684;&#x6548;&#x679C;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x767B;&#x5F55;&#x540E;&#x7684;&#x6548;&#x679C;</h3>
<p><img src="http://images.kaleozhou.top/3.1-02.png" alt="3.1-02.png"></p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; kaleozhou 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-05-20 16:21:26
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="readme.html" class="navigation navigation-prev " aria-label="Previous page: 第三章 laravel组件的使用">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="2.html" class="navigation navigation-next " aria-label="Next page: 3.2 注册验证码">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"3.1 用户脚手架","level":"1.4.1","depth":2,"next":{"title":"3.2 注册验证码","level":"1.4.2","depth":2,"path":"chapter3/2.md","ref":"chapter3/2.md","articles":[]},"previous":{"title":"第三章 laravel组件的使用","level":"1.4","depth":1,"path":"chapter3/readme.md","ref":"chapter3/readme.md","articles":[{"title":"3.1 用户脚手架","level":"1.4.1","depth":2,"path":"chapter3/1.md","ref":"chapter3/1.md","articles":[]},{"title":"3.2 注册验证码","level":"1.4.2","depth":2,"path":"chapter3/2.md","ref":"chapter3/2.md","articles":[]},{"title":"3.3 邮箱验证","level":"1.4.3","depth":2,"path":"chapter3/3.md","ref":"chapter3/3.md","articles":[]},{"title":"3.4 密码重置","level":"1.4.4","depth":2,"path":"chapter3/4.md","ref":"chapter3/4.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-sharing","splitter","expandable-chapters-small","anchors","donate","sharing-plus","anchor-navigation-ex","tbfed-pagefooter","favicon"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy kaleozhou 2019","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"github":{"url":"https://gitee.com/kaleozhou"},"splitter":{},"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"donate":{"alipay":"http://images.kaleozhou.top/zanshang.png","alipayText":" ","button":"赞赏","title":"","wechat":"","wechatText":"微信打赏"},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":false},"favicon":{"shortcut":"./book.ico","bookmark":"./book.ico","appleTouch":"./book.ico","appleTouchMore":{"120x120":"./book.ico","180x180":"./book.ico"}},"github-buttons":{"buttons":[{"user":"kaleozhou","repo":"guanwang","type":"star","size":"small","count":true}]},"expandable-chapters-small":{},"sharing":{"qq":true,"all":["weibo","qq","qzone"],"douban":true,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":true,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{}},"theme":"default","author":"kaleozhou","pdf":{"pageBreaksBefore":"/","paperSize":"a4","margin":{"right":30,"left":30,"top":30,"bottom":50},"fontSize":18,"pageSize":"a4","fontFamily":"Arial","doc":true,"chapterMark":"pagebreak","pageNumbers":true},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Laravel学习-从零开发论坛系统","language":"zh-hans","links":{"sidebar":{"我的博客":"http://www.kaleozhou.top"}},"gitbook":"3.2.3","description":"laravel框架开发论坛系统"},"file":{"path":"chapter3/1.md","mtime":"2019-05-20T08:21:26.912Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-25T02:56:39.861Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

